import { httpInstance } from '@/utils/request'

interface CreateProjectData {
  id?: string
  name: string
  province: string
  city: string
  district: string
  address: string
  longitude: string
  latitude: string
  extent: string
  project_type_id: string
  duration: string
  zx_style: string
  house_type: string
  money_total: string
  contract_images: string
  ask: string
  is_furniture: 1 | 0
  is_appliance: 1 | 0
  contacts_name: string
  contacts_mobile: string

  pay_images: string
  pay_time: string
  pay_money: string
  pay_desc: string
}

interface CreateProjectAPIResData {
  code: number
  data: null
  msg: string
  time: string
}

export function createProjectAPI(
  data: CreateProjectData,
  token: string,
) {
  return httpInstance.post<CreateProjectAPIResData, CreateProjectData>(
    'api/Project/projectSubmit',
    data,
    { headers: { token } },
  )
}
